<template>
  <div>
    <Header_h />
    <nav class="details_nav">
      <div class="containers">
        <span class="title_color" @click="$router.push('/login')">首页 / </span>
        <span class="title_color" @click="$router.push('/web/engineering')"
          >双家工程</span
        >
      </div>
    </nav>
    <article class="core_content">
      <div class="containers">
        <div class="enginer_box s_flex s_justify_content">
          <div class="enginer_left s_flex s_align_items s_flex-column">
            <div class="enginer_left_box">
              <div class="enginer_left_box_fiexd">
                <div
                  v-for="item in nav"
                  :key="item.id"
                  @click="showDetails(item.id)"
                  :class="curtIndex == item.id ? 'ck' : ''"
                >
                  {{ item.name }}
                </div>
              </div>
            </div>
          </div>
          <div class="enginer_right">
            <div>
              <div class="head s_flex s_align_items listshow1">
                <div class="user_imgs">
                  <img
                    :src="list.tpic"
                    alt=""
                  />
                </div>
                <div class="">
                  <h3>王彪</h3>
                  <div class="info">
                    <p><span class="ck">职称</span>: 教授</p>
                    <p><span class="ck">所属院系</span>: 物理学院</p>
                    <p>
                      <span class="ck">科研方向</span>:
                      细观力学、纳米材料物理力学、光电功能材料力学
                    </p>
                  </div>
                </div>
              </div>
              <div class="listshow2">
                <div class="introduction">
                  <h4 class="s_flex s_align_items title_color">
                    <span class="clonu"></span> 详细介绍:
                  </h4>
                </div>
                <div class="p_top">
                  <p v-html="list.content"></p>
                </div>
              </div>
              <div class="listshow3">
                <div class="introduction">
                  <h4 class="s_flex s_align_items title_color">
                    <span class="clonu"></span> 科研项目:
                  </h4>
                </div>
                <div class="p_top">
                  <p v-html="list.project"></p>
                </div>
              </div>
              <div class="listshow4">
                <div class="introduction">
                  <h4 class="s_flex s_align_items title_color">
                    <span class="clonu"></span> 发明专利:
                  </h4>
                </div>
                <div class="p_top">
                  <el-row>
                    <el-col
                      :lg="24"
                      class="hovers"
                      v-for="(item, index) in list.patent_list"
                      :key="index"
                    >
                      <p><span class="cril"></span>#{{ index + 1 }}</p>
                      <div class="patent_info">
                        <div class="info_img">
                          <el-image
                            style="
                              width: 140px;
                              height: 208px;
                              margin-top: 10px;
                            "
                            :src="item.imgname"
                            fit="contain"
                          ></el-image>
                        </div>
                        <div class="info_text">
                          <div
                            class="info_text_div"
                            style="display: flex; align-items: center"
                          >
                            <span class="Subhead">{{ item.pns }}</span>
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#4ba22f"
                              v-if="item.status == '授权'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#4ba22f"
                              v-if="item.status == '部分无效'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#4ba22f"
                              v-if="item.status == '权利恢复'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '未缴年费'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '撤回'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '驳回'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '期限届满'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '避重授权'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#6c778b"
                              v-if="item.status == '全部撤销'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#da7b21"
                              v-if="item.status == '实质审查'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              class="patent_tag_sq"
                              effect="dark"
                              style="border: none"
                              size="small"
                              color="#da7b21"
                              v-if="item.status == '公开'"
                              >{{ item.status }}</el-tag
                            >
                            <el-tag
                              style="
                                height: 25px;
                                line-height: 25px;
                                margin-right: 5px;
                                margin-bottom: 5px;
                              "
                              size="small"
                              v-for="(t, s) in item.event"
                              :key="s"
                              v-if="item.event.length > 0"
                              effect="plain"
                              type=""
                              >{{ t }}</el-tag
                            >
                          </div>
                          <div class="info_text_div">
                            <span class="sz">{{ item.tic }}</span>
                          </div>
                          <div class="info_text_div">
                            <p class="context" style="margin-bottom: 10px">
                              公告日：{{ item.pd }}
                            </p>
                            <p class="context">
                              {{ item.apc }}
                            </p>
                          </div>
                          <div class="info_text_div">
                            <p class="context zy_color">摘要</p>
                            <p class="context w">
                              {{ item.absc }}
                            </p>
                          </div>
                          <div class="info_text_div" v-if="item.is_zx == 1">
                            <el-button
                              @click.stop="service(item)"
                              type="primary"
                              >咨询专利保险</el-button
                            >
                          </div>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </article>
    <Footer />
    <navItem />
    <rightMenu @moveTo="moveTo" />

  </div>
</template>

<script>
import Header_h from "@/components/Header_h";
import Footer from "@/components/Footer";
import rightMenu from "@/components/web/rightMenu";
import { projectInfo } from "@/api/web";

export default {
  components: {
    Header_h,
    Footer,
    
    rightMenu
  },
  data() {
    return {
      list: [],
      curtIndex: 1,
      nav: [
        {
          id: 1,
          name: "基本信息",
        },
        {
          id: 2,
          name: "详细介绍",
        },
        {
          id: 3,
          name: "科研项目",
        },
        {
          id: 4,
          name: "发明专利",
        },
      ],
      showIndex: 1,
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
      moveTo() {
      window.scrollTo(0, 0);
    },
    async getList() {
      try {
        this.list = await projectInfo({ project_id: this.$route.query.id });
      } catch (error) {
        this.$message.success(error.message);
      }
    },
    showDetails(num) {
      this.curtIndex = num;
      var el = document.getElementsByClassName(`listshow${num}`)[0];
      // console.log(el.offsetTop);
      if (this.showIndex == num) {
        this.showIndex = null;
      } else {
        this.showIndex = num;
      }
      this.$nextTick(function () {
        window.scrollTo({ behavior: "smooth", top: el.offsetTop });
      });
    },
  },
};
</script>

<style lang="less" scoped>
.details_nav {
  width: 100%;
  padding: 15px 0;
  background: #edf1f4;
}
.enginer_box {
  position: relative;
  .enginer_left {
    width: 20%;
    position: relative;

    .enginer_left_box {
      width: 100%;
      height: 186px;
      -webkit-box-shadow: 0px 0px 18px 0px rgb(103 105 113 / 7%);
      box-shadow: 0px 0px 18px 0px rgb(103 105 113 / 7%);
      border-radius: 10px;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center;
      position: absolute;
      top: 0;
      z-index: 1;
      left: 0;
      text-align: center;
      cursor: pointer;
      div {
        margin-top: 25px;
      }
      .enginer_left_box_fiexd {
        position: fixed;
        z-index: 1;
        background: #ffffff;
        width: 240px;
        height: 186px;
      }
    }
  }
  .enginer_right {
    width: 70%;
  }
}
.core_content {
  background: #f7fbfe;
  padding: 80px 0;
}
.enginer_right {
  .head {
    .user_imgs {
      width: 218px;
      height: 218px;
      margin-right: 47px;
      img {
        width: 100%;
        object-fit: contain;
      }
    }
  }
  .info {
    margin-top: 47px;
    p {
      margin-bottom: 18px;
    }
  }
}
.clonu {
  width: 5px;
  height: 19px;
  background: #0f6ac7;
  box-shadow: 1px 2px 4px 0px rgba(79, 135, 251, 0.35);
  display: inline-block;
  margin-right: 5px;
}
.introduction {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}
.p_top {
  padding: 40px 0;
}
.hovers {
  padding: 20px 0 0 20px;
  cursor: pointer;
}
.hovers:hover {
  background-color: #f4f5f7;
}
.patent_info {
  display: flex;
  margin: 10px 0;
  .info_img {
    width: 188px;
    height: 237px;
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(230, 233, 240, 1);
    border-radius: 5px;
    text-align: center;
  }
}
.info_text {
  margin-left: 30px;
  .info_text_div {
    margin-bottom: 19px;
  }
}
.patent_tag_sq {
  height: 24px;
  line-height: 24px;
  background: #45a321;
  border-radius: 4px;
  border: none;
}
.patent_tag_info {
  height: 24px;
  line-height: 24px;
  background: #6a7687;
  border-radius: 4px;
  border: none;
}
.patent_tag_orange {
  height: 24px;
  line-height: 24px;
  background: #ffa033;
  border-radius: 4px;
  border: none;
}
.Subhead {
  color: #2a8b2d;
  margin-right: 27px;
}
</style>